import random


class Fish():
    def __init__(self):
        self.x = random.randint(0, 10)
        self.y = random.randint(0, 10)

    def move(self):
        self.x = -1
        print('我游到了： {} {}'.format(self.x, self.y))


class Gold_Fish(Fish):
    pass


class Carp_Fish(Fish):
    pass


class Salmon_Fish(Fish):
    pass


class Shark_Fish(Fish):
    def __init__(self):
        super().__init__()  # 如果有多个父类，可以自动继承父类方法
        self.hungry = True

    def eat(self):
        if self.hungry:
            print('鲨鱼饿了，要吃点东西')
            self.hungry = Fish
        else:
            print('吃撑了， 鲨鱼不饿了')


fish = Fish()
fish.move()

gold_fish = Gold_Fish()
gold_fish.move()


shark = Shark_Fish()
shark.move()
shark.hungry = False
shark.eat()



